package com.piggy.common.core.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum FlowableRedisKeyEnums {
    CustomAttr("custom_attr", "流程自定义属性", FlowableRedisKeyEnums.flowPrefix),

    ;

    /** key **/
    private final String code;
    /** 描述 **/
    private final String desc;
    /**
     * 前缀
     */
    private final String prefix;

    private final static String flowPrefix = "flowable";


    public String getKey(Object...keys) {
        StringBuilder redisKey = new StringBuilder(this.prefix);
        redisKey.append(":").append(this.code);
        for(Object key : keys) {
            redisKey.append(":").append(key);
        }
        return redisKey.toString();
    }

}
